import React,{ Component } from 'react';
import { Table, message } from 'antd';
import {messages} from "share/common";
import DetailSever from 'containers/supplier-management/overview/supplier-detail/supplier-detail.service'


class HeliosHotelDetail extends Component{

  constructor(props){
    super(props);
    this.state = {
      data:[],
      column:[
        {title:messages('components.key10'/*名称*/),dataIndex:'name'},
        {title:messages('common.column.status')/*状态*/,dataIndex:'value'},
        {title:messages('common.remark')/*备注*/,dataIndex:'msg'},
      ],
    }
  }

  componentWillMount(){
    this.getDetailData();
  }

  getDetailData = () => {
    DetailSever.getHeliosHotel().then(res => {
      if(res.status === 200){
        this.setState({data:res.data.body});
      }
    }).catch(err => {
      message.error(err.response.data.message);
    })
  }

  render(){
    const { column, data } = this.state;
    return (
      <div>
        <h3>{messages('supplier.key195')/*功能特性*/}</h3>
        <Table rowKey={record =>record.name} dataSource={data} columns={column} bordered/>
      </div>
    )
  }
}

export default HeliosHotelDetail;
